import ReconciliationAndPaymentRequest from './reconciliationAndPaymentRequest'
import EstimatedBookkeeping from './estimatedBookkeeping'
import PredictiveAccounting from './predictiveAccounting'
import ReconciliationControl from './reconciliationControl'
import HistoricalRecall from './historicalRecall'

const comMap = {
  1: ReconciliationAndPaymentRequest, // 对账请款
  2: EstimatedBookkeeping, // 预估记账
  3: PredictiveAccounting, // 预测记账
  4: ReconciliationControl, // 调账控制
  6: HistoricalRecall, // 历史回溯
}

export default {
  type: 'tabs',
  api: {
    url: '/system/dict/data/type/business_menu_tab_type',
    responseAdaptor: (response) => {
      response.data = response.data.map((item) => {
        return {
          label: item.dictLabel,
          name: item.dictValue,
          lazy: true,
          body: comMap[item.dictValue]
        }
      })
      return response
    }
  }
}
